<template>
  <yd-ls-layout title="服务协议" :onfoot=false :tolfurl="urls" style="background-color: rgb(255,255,255)">
    <div class="yd-ls-height"></div>
    <yd-ls-content>
      <div slot="content">
        <div class="yd-ls-prototcol" v-html="contents"></div>
      </div>
    </yd-ls-content>
    <!--<yd-backtop></yd-backtop>-->
  </yd-ls-layout>
</template>

<style>
  .yd-ls-prototcol h1 {
    font-size: .38rem;
    padding-bottom: .3rem;
  }
  .yd-ls-prototcol h3 {
    padding: .2rem 0
  }
  .yd-ls-prototcol li {
    padding-bottom: .15rem
  }
  .yd-ls-prototcol li:last-child {
    padding-bottom: 0;
  }
</style>
<script>
  import ydLsLayout from '../../../components/yd-ls-layout.vue'
  import ydLsContent from '../../../components/yd-ls-content.vue'
  import api from '../../../axios/api'

  export default {
    name: 'prototcol',
    data() {
      return {
        urls: 'index.html#/setting',
        contents: []
      }
    },
    methods: {
      init() {
        this.getPrototcol()
        this.toUrls()
      },
      getPrototcol() {
        this.$dialog.loading.open(api.default_loading_txt);
        this.axios.get(api.base_prototcol)
          .then(m=>{
            let base_prototcol_data = m.data
            this.contents = base_prototcol_data.data
            this.$dialog.loading.close()
          }).catch(err=>{
            this.$dialog.loading.close()
            this.$dialog.alert({mes: JSON.stringify(err)})
          })
      },
      toUrls() {
        const param_reg = this.$route.query.isreg - 0
        if(param_reg) {
          this.urls = "index.html#/reg"
        }
      },
    },
    mounted() {
      this.init()
    },
    components: { ydLsLayout, ydLsContent }


  }
</script>
